//
//  SDSessionManager.h
//  skinDetection
//
//  Created by  liangzhun on 2018/11/7.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "AFHTTPSessionManager.h"

NS_ASSUME_NONNULL_BEGIN

@interface SDSessionManager : AFHTTPSessionManager
+ (instancetype)shareManager;

+ (void)SDPOST:(NSString *)URLString parameters:(id __nullable)parameters success:(void (^)(NSURLSessionDataTask * _Nonnull task, NSDictionary *_Nullable responseObject))success failure:(void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error))failure;

+ (void)SDGET:(NSString *)URLString parameters:(id __nullable)parameters success:(void (^)(NSURLSessionDataTask * _Nonnull task, NSDictionary *_Nullable responseObject))success failure:(void (^)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error))failure;

/**
 上传文件

 @param URLString 网址
 @param parameters 参数
 @param block 结构
 @param uploadProgress 进度
 @param success 成功
 @param failure 失败
 */
+ (void)SDPOST:(NSString *)URLString
    parameters:(id __nullable)parameters
constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block
      progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress
       success:(void (^)(NSURLSessionDataTask *task, id responseObject))success
       failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure;

@end

NS_ASSUME_NONNULL_END
